using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace ScannerLib.Tsai
{
    [Serializable]
    public class CalibrationPoint
    {
        private double m_x, m_y;
        private double m_px, m_py;
        private int m_number = 0;

        public CalibrationPoint(int number)
        {
            m_number = number;
        }
        
        [Browsable(false)]
        public double X
        {
            get
            {
                return m_x;
            }

            set
            {
                m_x = value;
            }
        }

        [Browsable(false)]
        public double Y
        {
            get
            {
                return m_y;
            }

            set
            {
                m_y = value;
            }
        }

        public double PX
        {
            get
            {
                return m_px;
            }

            set
            {
                m_px = value;
            }
        }


        public double PY
        {
            get
            {
                return m_py;
            }

            set
            {
                m_py = value;
            }
        }

        [Browsable(false)]
        public int RoundX
        {
            get
            {
                return (int)Math.Round(X);
            }
        }

        [Browsable(false)]
        public int RoundY
        {
            get
            {
                return (int)Math.Round(Y);
            }
        }

        public override string ToString()
        {
            return "Point " + m_number;
        }
    }

    public class FPoint
    {
        private float m_x, m_y;

        public FPoint(float x, float y)
        {
            m_x = x;
            m_y = y;
        }

        public float X
        {
            get
            {
                return m_x;
            }

            set
            {
                m_x = value;
            }
        }

        public float Y
        {
            get
            {
                return m_y;
            }

            set
            {
                m_y = value;
            }
        }

        public override string ToString()
        {
            return X + " " + Y;
        }
    }
    public class PointPair
    {
        private FPoint m_start = new FPoint(0, 0);
        private FPoint m_end = new FPoint(0, 0);
        private int m_number = 0;
        private static int s_number = 1;

        public PointPair() { m_number = s_number++; }

        public FPoint Start
        {
            get
            {
                return m_start;
            }
        }

        public FPoint End
        {
            get
            {
                return m_end;
            }
        }

        public override string ToString()
        {
            return "Sample " + m_number;
        }
    }
}
